import 'package:get_it/get_it.dart';
import '../core/network/dio_provider.dart';
import '../features/auth/domain/auth_repository.dart';
import '../features/auth/data/auth_api.dart';
import '../features/auth/application/auth_view_model.dart';
import '../features/article/domain/article_repository.dart';
import '../features/article/data/article_api.dart';
import '../features/article/application/article_view_model.dart';

final getIt = GetIt.instance;

void setupLocator() {
  getIt.registerLazySingleton(() => DioProvider().dio);
  getIt.registerLazySingleton<AuthRepository>(() => AuthApi(getIt()) as AuthRepository);
  getIt.registerFactory(() => AuthViewModel(getIt()));
  getIt.registerLazySingleton<ArticleRepository>(() => ArticleApi(getIt()) as ArticleRepository);
  getIt.registerFactory(() => ArticleViewModel(getIt()));
}